﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" CodeFile="Posts.aspx.cs" Inherits="Posts" %>
<asp:Content ID="Content1" runat="server" contentplaceholderid="MainContent">
    <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="Scripts/Posts.js" type="text/javascript"></script>
    <div>   
        <table id="postTable" border="1" class = "postsattr" style="width: 68%;">
            <tr>
                <th></th>
                <th class="style5"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Header  &nbsp;</th>
                <th class="style6"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Publish At  &nbsp;</th>
                <th> Create by&nbsp;</th>
            </tr>
            
        </table>
    </div>
    <div align="left"><!-- here is the post body value. -->
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           <textarea id="PostBody" rows="5" cols="80" name="textbox_message" readonly="readonly" style="display:none"></textarea>
            <br />
            
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            
            <asp:Label ID="CheckBoxErrorLabel" runat="server" Font-Bold="True" Font-Size="13pt" 
                ForeColor="Red"></asp:Label>
            <br />
            <br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input id="ShowAddPostButton" type="button" value="Add Post" onclick="showAddPostClicked()"/>
            <input id="ShowEditPostButton" type="button" value="Edit Post" onclick="showEditPostClicked('<%=Session["username"]%>', '<%=Session["isModerator"]%>')"/>
            <input id="DeletePostButton" type="button" value="Delete Post" onclick="deletePostClicked('<%=Session["username"]%>')"/>
    </div>
    <div align="left">
         <br/>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <br/>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="AddPostHeaderLabel" runat="server" Text="Header" style="display:none"></asp:Label>
        
        &nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox ID="AddPostHeaderTextBox" 
             runat="server" Width="300px" style="display:none"></asp:TextBox>
         <br />
         <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="AddPostBodyLabel" runat="server" Text="Body" style="display:none"></asp:Label>
        <br/>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <asp:TextBox ID="AddPostBodyTextBox" runat="server" Height="150px" 
             Width="300px" TextMode="MultiLine" style="display:none"></asp:TextBox>
         <br/>
         <br/>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <input id ="AddPostButton" type = "button" onclick="addEditButtonClick('<%=Session["username"]%>', true)" value = "Add" style="display:none" /> 
             <input id ="EditPostButton" type = "button" onclick="addEditButtonClick('<%=Session["username"]%>', false)" value = "Edit" style="display:none" /> 
             <input id ="CancelButton" type = "button" onclick="cancelClick()" value = "Cancel" style="display:none" /> 
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br/>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <!--<asp:Label ID="AddPostErrorLabel" runat="server" Text="Error" ForeColor="Red" 
             style="display:"></asp:Label>-->
        <!--<input id="ErrorLabel" type="text" style="display:none;color: #FF0000; font-weight: bold;" 
             value="Error Label" />-->
        <asp:Label ID="ErrorLabel" runat="server" Text="Error" ForeColor = "Red" style = "display:none"></asp:Label>
    </div>
    <asp:TextBox ID="localIdText" runat="server" style="display:none"></asp:TextBox>
    <script language="javascript" type="text/javascript">
        function getUsername() {
            var user = '<%=Session["username"]%>';
            return user;
        }
    </script>
</asp:Content>

<asp:Content ID="Content2" runat="server" contentplaceholderid="HeadContent">
    <style type="text/css">
        .style5
        {
            width: 613px;
        }
        .style6
        {
            width: 148px;
        }
    </style>
</asp:Content>
